﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace socialnetworkApp.Domain.Models
{
    public class Users
    {
        public Users(string Uid) { 
        
            Id = Uid;
        
        }
        public Users() { }  

        [Key, Column("id")]
        [MaxLength(50)]
        public string Id { get; set; }
        [Column("user_name")]
        public string?  Username { get; set; }
        [Column("idx_unique")]
        public int? IdxUnique { get; set; }

        [Column("nickname")]
        [MaxLength(50)]
        public string? Nickname { get; set; }

        [Column("email")]
        [MaxLength(100)]
        public string? Email { get; set; }
        [ Column("signature")]
        [MaxLength(100)]
        public string? Signature { get; set; }
        [Column("sex")]
        public string? Sex { get; set; }
        [Column("headeImg")]
        public string? HeadeImg { get; set; }

        [Column("password")]
        [MaxLength(100)]
        public string? Password { get; set; }

        public string? Phone { get; set; }
  
        [Column("routes")]
        public string? Routes { get; set; }
        /// <summary>
        /// 存储的是该用户下的所有角色id
        /// </summary>
        [Column("roles")]
        public string? Roles { get; set; }
        [Column("buttons")]
        public string? Buttons { get; set; }


        [Column("created_at")]
        public DateTime? CreatedAt { get; set; } = DateTime.Now;
        [Column("update_time")]

        public DateTime? UpdateTime { get; set; }
    }

}
